SET(TARGET_NAME EDesigner)
#PROJECT(${TARGET_NAME})
#必须要有的宏定义
#ADD_DEFINITIONS (-DdebugWidgetDataBase)



#INCLUDE_DIRECTORIES("..\\..\\include")
#LINK_DIRECTORIES("..\\..\\lib")
IF (CMAKE_CL_64)
ELSE()
ENDIF()
	INCLUDE_DIRECTORIES( ${OSG_DIR}/include )
	LINK_DIRECTORIES( ${OSG_DIR}/lib )

	INCLUDE_DIRECTORIES( ${OSG_WORKS_DIR}/include )
	LINK_DIRECTORIES( ${OSG_WORKS_DIR}/lib )

	INCLUDE_DIRECTORIES( ${LUA_DIR}/include)
	LINK_DIRECTORIES( ${LUA_DIR}/lib)
	
	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/include)
        #LINK_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib )
        LINK_DIRECTORIES( ${PROJECT_BINARY_DIR}/lib )
	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include)
	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/${TARGET_NAME})
	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/${TARGET_NAME}/share/include)
        LINK_DIRECTORIES( ${PROJECT_BINARY_DIR}/${TARGET_NAME}/lib )


	INCLUDE_DIRECTORIES( ${QT_DIR}/include)
	INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/EDesignerLib/include)
	#INCLUDE_DIRECTORIES( ${QT_DIR}/include/QtDesigner)
	#INCLUDE_DIRECTORIES( ${QT_DIR}/include/QtDesigner/private)
	#INCLUDE_DIRECTORIES( ${QT_DIR}/tools/shared/qttoolbardialog)
	#INCLUDE_DIRECTORIES( ${QT_DIR}/tools/shared/fontpanel)

	LINK_DIRECTORIES( ${QT_DIR}/lib)

        INCLUDE_DIRECTORIES( ${OPEN_THREADS}/include)
        LINK_DIRECTORIES( ${OPEN_THREADS}/lib)



find_package(QT4 REQUIRED)
INCLUDE (${QT_USE_FILE})
ADD_DEFINITIONS (${QT_DEFINITIONS})

FILE(GLOB QTDEMO_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include_ui/*.h" )
FILE(GLOB_RECURSE ThisTarget_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/include/*.h")
FILE(GLOB_RECURSE ThisTarget_SRC_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/src/*.cpp")



FILE(GLOB QTDEMO_UI_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/ui/*.ui")
FILE(GLOB QTDEMO_RESOURCE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/resources/*.qrc")
#share文件夹
FILE(GLOB SHARE_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/share/include/*.h" )
FILE(GLOB SHARE_SRC_LIST "${PROJECT_SOURCE_DIR}/${TARGET_NAME}/share/src/*.cpp" )

source_group("include" FILES ${ThisTarget_INCLUDE_LIST})
source_group("src" FILES ${ThisTarget_SRC_LIST})

source_group("includeShare" FILES ${SHARE_INCLUDE_LIST})
source_group("srcShare" FILES ${SHARE_SRC_LIST})


source_group("ui" FILES ${QTDEMO_UI_LIST})
source_group("resource" FILES ${QTDEMO_RESOURCE_LIST})
QT4_WRAP_CPP(example_MOCS 	${ThisTarget_INCLUDE_LIST})
QT4_WRAP_CPP(example_MOCS_Share 	${SHARE_INCLUDE_LIST})
QT4_WRAP_UI(example_UIS		${QTDEMO_UI_LIST})
QT4_ADD_RESOURCES(example_RCC_SRCS  ${QTDEMO_RESOURCE_LIST})
source_group("generated_file" FILES ${example_MOCS} ${example_UIS} ${example_RCC_SRCS})

#${example_MOCS_Share}
ADD_EXECUTABLE(${TARGET_NAME} ${ThisTarget_SRC_LIST} ${SHARE_SRC_LIST} ${ThisTarget_INCLUDE_LIST} ${SHARE_INCLUDE_LIST} ${example_MOCS} ${example_UIS}  ${example_RCC_SRCS} ${QTDEMO_INCLUDE_LIST} ${QTDEMO_UI_LIST} ${QTDEMO_RESOURCE_LIST} )

SET(ADDITIONAL_LIBRARIES_RELEASE

				# osg.lib
				# osgViewer.lib
				# osgDB.lib
				# osgGA.lib
				# osgText.lib
				# osgUtil.lib
				# osgShadow.lib
				# osgSim.lib
				# osgManipulator.lib
				# osgQt.lib

				# OpenThreads.lib

				# osgwTools.lib

				# lua.lib
				# #libxl.lib
				# OsgEditor_dll.lib
				# AssemblyLibrary.lib
				QtOpenGL4.lib
				#${QT_DESIGNER_LIB_DIR}/QtDesigner4.lib
				#D:\ProgramFiles/Qt/4.8.6/tools/designer/src/components/lib/debug/QtDesignerComponents4.lib
				QtXml4.lib
				QtNetwork4.lib
				EDesignerLib.lib
                                OpenThreads.lib
				)

SET(ADDITIONAL_LIBRARIES_DEBUG

				# osgd.lib
				# osgViewerd.lib
				# osgDBd.lib
				# osgGAd.lib
				# osgTextd.lib
				# osgUtild.lib
				# osgShadowd.lib
				# osgSimd.lib
				# osgManipulatord.lib
				# osgQtd.lib

				# osgwToolsd.lib

				# luad.lib

				# OsgEditor_dlld.lib
				# AssemblyLibraryd.lib
				QtOpenGLd4.lib
				#${QT_DESIGNER_LIB_DIR}/QtDesignerd4.lib
				#D:\ProgramFiles/Qt/4.8.6/tools/designer/src/components/lib/debug/QtDesignerComponentsd4.lib
				QtXmld4.lib
				QtNetworkd4.lib
				EDesignerLibd.lib
                                OpenThreadsd.lib
				)
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${QT_LIBRARIES})

TARGET_LINK_LIBRARIES(${TARGET_NAME} debug "${ADDITIONAL_LIBRARIES_DEBUG}" optimized "${ADDITIONAL_LIBRARIES_RELEASE}")
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/bin)
set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/bin)









